package bean;

import java.io.Serializable;
import java.util.Date;

public class PrediccionMuerte implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	//lo puse para la base de datos, en el programa no lo uso, si no sirve se saca
	private Long id;
	
	private Date periodoInicial;
	private Date periodoFinal;
	private String codCategoria;
	private float prediccion;
	
	public PrediccionMuerte(Date periodoInicial, Date peridioFinal,
			String codCategoria, float prediccion) {
		super();
		
		this.periodoInicial = periodoInicial;
		this.periodoFinal = peridioFinal;
		this.codCategoria = codCategoria;
		this.prediccion = prediccion;
	}
	
	public PrediccionMuerte(){}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getPeriodoInicial() {
		return periodoInicial;
	}

	public void setPeriodoInicial(Date periodoInicial) {
		this.periodoInicial = periodoInicial;
	}

	public Date getPeridioFinal() {
		return periodoFinal;
	}

	public void setPeridioFinal(Date peridioFinal) {
		this.periodoFinal = peridioFinal;
	}

	public String getCodCategoria() {
		return codCategoria;
	}

	public void setCodCategoria(String codCategoria) {
		this.codCategoria = codCategoria;
	}

	public float getPrediccion() {
		return prediccion;
	}

	public void setPrediccion(float prediccion) {
		this.prediccion = prediccion;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((codCategoria == null) ? 0 : codCategoria.hashCode());
		result = prime * result
				+ ((periodoFinal == null) ? 0 : periodoFinal.hashCode());
		result = prime * result
				+ ((periodoInicial == null) ? 0 : periodoInicial.hashCode());
		result = prime * result + Float.floatToIntBits(prediccion);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PrediccionMuerte other = (PrediccionMuerte) obj;
		if (codCategoria == null) {
			if (other.codCategoria != null)
				return false;
		} else if (!codCategoria.equals(other.codCategoria))
			return false;
		if (periodoFinal == null) {
			if (other.periodoFinal != null)
				return false;
		} else if (!periodoFinal.equals(other.periodoFinal))
			return false;
		if (periodoInicial == null) {
			if (other.periodoInicial != null)
				return false;
		} else if (!periodoInicial.equals(other.periodoInicial))
			return false;
		if (Float.floatToIntBits(prediccion) != Float
				.floatToIntBits(other.prediccion))
			return false;
		return true;
	}
	
}
